using OrderService.Domain.Models;
using SharedKernel.Domain.Events;

namespace OrderService.Domain.Events
{
    /// <summary>
    /// 订单状态变更事件
    /// </summary>
    public class OrderStatusChangedEvent : DomainEvent<Order>
    {
        /// <summary>
        /// 新的订单状态
        /// </summary>
        public OrderStatus NewStatus { get; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="order">订单实体</param>
        /// <param name="newStatus">新的订单状态</param>
        /// <param name="remark">备注</param>
        public OrderStatusChangedEvent(Order order, OrderStatus newStatus, string remark = null) : base(order)
        {
            NewStatus = newStatus;
            Remark = remark;
        }
    }
}